<template>
  <div id="app">
    <div v-show="isShow">
      <div class="top">
      <div class="log"><h2>啃文书库</h2></div>
      <div>
        <input type="text" value="" name="sousuo" placeholder="请输入书籍名称">
      </div>
    </div>
    </div>

    <router-view></router-view>

    <van-tabbar
      style="
        height: 80px;
        text-align: center;
        background: #1e1e1e;
        border-top: 1px solid #585757;
      "
      v-model="active"
      inactive-color="#FFD539"
      active-color="#000"
      route
    >
      <van-tabbar-item to="/shucheng" ref="btn" @click="show">
        <p><span class="iconfont icon-shouye"></span></p>
        书城
      </van-tabbar-item>
      <van-tabbar-item to="/shujia" ref="btn" @click="show">
        <p><span class="iconfont icon-gongzuojilu"></span></p>
        书架
      </van-tabbar-item>
      <van-tabbar-item to="/fenlei" ref="btn" @click="show">
        <p><span class="iconfont icon-wodedingdan"></span></p>
        分类
      </van-tabbar-item>
      <van-tabbar-item to="/wode" ref="btn" @click="sShow" >
        <p><span class="iconfont icon-icongerenzhongxin-01"></span></p>
        我的
      </van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
import Vue from 'vue'
import { Tabbar, TabbarItem } from 'vant'
import '@/assets/iconfont/iconfont.css'

Vue.use(Tabbar)
Vue.use(TabbarItem)

export default {
  data() {
    return {
      active: 0,
      isShow: true
    }
  },
  methods: {
    color() {
      // console.log(this)
      // this.style.background = "red"
    },
    show(){
      this.isShow = true
    },
    sShow(){
      this.isShow = false
    }
  },
}
</script>


<style lang="scss">
#app {
  >div{
    > .top {
    height: 80px;
    background: #1e1e1e;
    color: #ffd539;
    border-bottom: 1px solid gray;
    display: flex;
    // flex-direction: column;
    justify-content: space-between;
    .log {
      margin-left: 15px;
      h2 {
        line-height: 40px;
      }
    }
    :nth-child(2) {
      margin-right: 10px;
      input {
        padding: 5px 10px;
        background-color: rgb(226, 207, 34);
        color: black;
        margin-left: 10px;
        margin-top: 25px;
      }
    }
  }
  .van-tabbar-item--active{
    background-color: #ffd539;
    color:black;
  }
  }
}
</style>
